/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package efrei.ete.util;

import efrei.ete.bean.Floor;
import java.util.ArrayList;
import java.util.Date;

/**
 *
 * @author Frank
 */
public class Util {

    public static ArrayList getPostFloorList() {
        ArrayList<Floor> floorList = new ArrayList<Floor>();
        floorList.add(new Floor(1, 1, true, "title1", 1, new Date(), "detail"));
        floorList.add(new Floor(1, 1, true, "title2", 2, new Date(2010, 1, 1), "detail"));
        floorList.add(new Floor(1, 1, true, "title3", 3, new Date(1989, 10, 8), "detail"));
        return floorList;
    }

    public static String getNameById(int id) {
        switch (id) {
            case 1:
                return "name1";
            case 2:
                return "name1";
            case 3:
                return "name1";
            default:
                return "nameD";
        }
    }

    public static String dateToString(Date date) {
        int year = 1900 + date.getYear();
        return year + "." + date.getMonth() + "." + date.getDay();
    }

    public static Floor getHead(int postId) {
        return new Floor(1, 1, true, "title1", 1, new Date(), "yaozenyanga");
    }

    public static String timeToString(Date date) {
        return date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds()
                + " " + dateToString(date);

    }

    public static ArrayList getFloorListByPostId(int postId) {
        ArrayList<Floor> floorList = new ArrayList<Floor>();
        floorList.add(new Floor(1, 1, false, "title1", 1, new Date(), "detail"));
        floorList.add(new Floor(2, 1, false, "title2", 2, new Date(2010, 1, 1), "detail"));
        floorList.add(new Floor(3, 1, false, "title3", 3, new Date(1989, 10, 8), "detail"));
        return floorList;
    }
}
